
import java.util.Scanner;
public class Text3 {
    public static int getDays(int year, int month) {
        switch (month) {
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                return 31;      //大月
            case 4:
            case 6:
            case 9:
            case 11:
                return 30;
            case 2:
                if (year % 4 == 0 && year % 100 != 0) {
                    return 29;
                } else {
                    return 28;
                }
        }
        return 0;
    }

    public static int Su(int a) {
        if (a == 2 || a == 3 || a == 5 || a == 7 || a == 11) {
            return 1;
        } else {
            return 2;
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int year1 = scanner.nextInt();
            int month1 = scanner.nextInt();
            int day1 = scanner.nextInt();
            int year2 = scanner.nextInt();
            int month2 = scanner.nextInt();
            int day2 = scanner.nextInt();
            if (year1 == year2 && month1 == month2) {
                int g = Su(month1);
                System.out.println(g * (day2 - day1 + 1));
            }
            if (year1 == year2 && month1 != month2) {
                int sum = 0;
                sum += (getDays(year1, month1) - day1 + 1) * Su(month1);       //起始月份剩余天数的钱
                for (int i = month1 + 1; i < month2; i++) {
                    sum += getDays(year1, i) * Su(i);             //中间月份的钱
                }
                sum += day2 * Su(month2);                    //结束月的钱
                System.out.println(sum);
            }
            if (year1 != year2) {
                int sum = 0;
                sum += (getDays(year1, month1) - day1 + 1) * Su(month1);    //起始该月剩余天数的钱
                for (int i = month1 + 1; i <= 12; i++) {
                    sum += getDays(year1, i) * Su(i);                  //该年其他月的钱
                }
                for (int i = year1 + 1; i < year2; i++) {
                    for (int j = 1; j <= 12; j++) {
                        sum += getDays(i, j) * Su(j);          //中间年的钱
                    }
                }

            }
        }
    }
}
